/**
 * 
 */
package com.taobao.wolfwolf.hibernate.service.impl;

import java.util.List;

import com.taobao.wolfwolf.hibernate.dao.LogisticsDao;
import com.taobao.wolfwolf.hibernate.pojo.Logistics;
import com.taobao.wolfwolf.hibernate.service.LogisticsService;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 下午08:11:54
 */
public class LogisticsServiceImpl extends BaseServiceImpl implements LogisticsService {
	private LogisticsDao ldao;

	public List<Logistics> findAll() {
		try {
			return ldao.findAll();
		} catch(Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Logistics findById(int id) {
		try {
			return ldao.findById(id);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findById(int id)");
		}
		return null;
	}

	public List<Logistics> findByName(String name) {
		try {
			return ldao.findByName(name);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at findByName(String name)");
		}
		return null;
	}

	public long getTotal()  {
		try {
			return ldao.getTotal();
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at getTotal()");
		}
		return -1;
	}

	public List<Logistics> paging(int page, int limit)  {
		try {
			return ldao.paging(page, limit);
		}  catch (Exception e) {
			e.printStackTrace();
			System.out.println("Error at paging(int page, int limit)");
		}
		return null;
	}

	public void setldao(LogisticsDao ldao) {
		this.ldao = ldao;
	}

	public LogisticsDao getldao() {
		return ldao;
	}
}
